﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DotNet.Highcharts;
using log4net;
using StockPredictor.App_Start;
using StockPredictor.Models;

namespace StockPredictor.Utilities
{
    public static class StockChartHelper
    {
        /// <summary>
        /// build test chart results
        /// </summary>
        /// <returns></returns>
        public static List<HighStockPointModel> GetChartResults(string stockSymbol)
        {
            var results = new List<HighStockPointModel>();

            List<HistoricalStock> historicalData = YahooFinance.GetHistoricalStockData(stockSymbol, YahooFinance.intervalStep.Daily);

            for (int i = 0; i < historicalData.Count; i++)
            {
                results.Add(new HighStockPointModel(historicalData[i]));
            }

            return results;
        }
    }
}